package com.yupi.springbootinit.config;

import com.zhipu.oapi.ClientV4;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.TimeUnit;

import static com.yupi.springbootinit.constant.AiConstant.API_KEY;

/**
 * 智普AI配置类
 * 解决调用超时问题
 */
@Configuration
public class ClientV4Config {
    @Bean
    public ClientV4 client() {
        return new ClientV4.Builder(API_KEY)
                .networkConfig(30,60,60,60, TimeUnit.SECONDS)
                .build();
    }
}
